﻿using System;
using System.Linq;
using System.Collections.Generic;

using SimpleForum.Data.Models;
using SimpleForum.Data.Repositories;

namespace SimpleForum.Data.Services
{
    public class CategoryService : ICategoryService
    {
        private readonly IRepository<Category> CategoryRepository;

        public CategoryService(IRepository<Category> CategoryRepository)
        {
            this.CategoryRepository = CategoryRepository;
        }

        public Category GetCategory(int Id)
        {
            return CategoryRepository.Get(Id);
        }

        public IEnumerable<Category> GetCategories()
        {
            return CategoryRepository.Get();
        }
    }
}